//
//  NSDate+TPSChat.m
//  TPSLIVE
//
//  Created by 贺森 on 2017/11/8.
//  Copyright © 2017年 HS. All rights reserved.
//

#import "NSDate+TPSChat.h"
#import "NSDate+Extensions.h"
#import "NSDate+Relation.h"

@implementation NSDate (TPSChat)

- (NSString *)chatTimeInfo
{
    if ([self isToday]) {       // 今天
        return self.formatHM;
    }
    else if ([self isYesterday]) {      // 昨天
        return [NSString stringWithFormat:@"昨天 %@", self.formatHM];
    }
//    else if ([self isThisWeek]){        // 本周
//        return [NSString stringWithFormat:@"%@ %@", self.formatWeekday, self.formatHM];
//    }
    else {
        return [NSString stringWithFormat:@"%@ %@", self.formatYMD, self.formatHM];
    }
}

- (NSString *)conversaionTimeInfo
{
    if ([self isToday]) {       // 今天
        return self.formatHM;
    }
    else if ([self isYesterday]) {      // 昨天
        return [NSString stringWithFormat:@"昨天 %@", self.formatHM];
    }
//    else if ([self isThisWeek]){        // 本周
//        return self.formatWeekday;
//    }
    else {
        return [NSString stringWithFormat:@"%@ %@", self.formatYMD, self.formatHM];
    }
}

- (NSString *)chatFileTimeInfo
{
    if ([self isThisWeek]) {
        return @"本周";
    }
    else if ([self isThisMonth]) {
        return @"这个月";
    }
    else {
        return [NSString stringWithFormat:@"%ld年%ld月", (long)self.year, (long)self.month];
    }
}


@end
